.class LPlugclass/updateManager$3;
.super Ljava/lang/Thread;
.source "updateManager.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = LPlugclass/updateManager;->downupdate()Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:LPlugclass/updateManager;


# direct methods
.method constructor <init>(LPlugclass/updateManager;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, LPlugclass/updateManager$3;->this$0:LPlugclass/updateManager;

    .line 108
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 10

    .prologue
    .line 110
    invoke-super {p0}, Ljava/lang/Thread;->run()V

    .line 113
    iget-object v8, p0, LPlugclass/updateManager$3;->this$0:LPlugclass/updateManager;

    # getter for: LPlugclass/updateManager;->mContext:Landroid/content/Context;
    invoke-static {v8}, LPlugclass/updateManager;->access$8(LPlugclass/updateManager;)Landroid/content/Context;

    move-result-object v8

    invoke-virtual {v8}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v3

    check-cast v3, Lmyapp/MyApp;

    .line 114
    .local v3, "m":Lmyapp/MyApp;
    const-string v8, "\u66f4\u65b0"

    invoke-virtual {v3}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Lmyapp/Mylog;->v(Ljava/lang/String;Ljava/lang/String;)V

    .line 117
    new-instance v8, Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v9

    invoke-static {v9}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v9, "/index.php?ctrl=app&action=checkupdate&apptype=buyer&datatype=json"

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    .line 118
    .local v7, "url":Ljava/lang/String;
    invoke-static {v7, v3}, LPlugclass/HttpConn;->getStr(Ljava/lang/String;Lmyapp/MyApp;)Ljava/lang/String;

    move-result-object v6

    .line 120
    .local v6, "str":Ljava/lang/String;
    :try_start_0
    new-instance v2, Lorg/json/JSONObject;

    invoke-direct {v2, v6}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 122
    .local v2, "json":Lorg/json/JSONObject;
    const-string v8, "error"

    invoke-virtual {v2, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v9, "true"

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 144
    .end local v2    # "json":Lorg/json/JSONObject;
    :cond_0
    :goto_0
    return-void

    .line 125
    .restart local v2    # "json":Lorg/json/JSONObject;
    :cond_1
    const-string v8, "msg"

    invoke-virtual {v2, v8}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v8

    if-nez v8, :cond_0

    .line 129
    const-string v8, "msg"

    invoke-virtual {v2, v8}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    .line 131
    .local v1, "jarray":Lorg/json/JSONObject;
    const-string v8, "appvison"

    invoke-virtual {v1, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-static {v8}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/Integer;->intValue()I

    move-result v5

    .line 132
    .local v5, "sitevison":I
    iget-object v8, p0, LPlugclass/updateManager$3;->this$0:LPlugclass/updateManager;

    # getter for: LPlugclass/updateManager;->localVersion:I
    invoke-static {v8}, LPlugclass/updateManager;->access$9(LPlugclass/updateManager;)I

    move-result v8

    if-le v5, v8, :cond_0

    .line 133
    new-instance v4, Landroid/os/Message;

    invoke-direct {v4}, Landroid/os/Message;-><init>()V

    .line 134
    .local v4, "msg":Landroid/os/Message;
    const/4 v8, 0x3

    iput v8, v4, Landroid/os/Message;->what:I

    .line 135
    iget-object v8, p0, LPlugclass/updateManager$3;->this$0:LPlugclass/updateManager;

    const-string v9, "appdownload"

    invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, LPlugclass/updateManager;->access$10(LPlugclass/updateManager;Ljava/lang/String;)V

    .line 136
    iget-object v8, p0, LPlugclass/updateManager$3;->this$0:LPlugclass/updateManager;

    # getter for: LPlugclass/updateManager;->mHandler:Landroid/os/Handler;
    invoke-static {v8}, LPlugclass/updateManager;->access$6(LPlugclass/updateManager;)Landroid/os/Handler;

    move-result-object v8

    invoke-virtual {v8, v4}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 141
    .end local v1    # "jarray":Lorg/json/JSONObject;
    .end local v2    # "json":Lorg/json/JSONObject;
    .end local v4    # "msg":Landroid/os/Message;
    .end local v5    # "sitevison":I
    :catch_0
    move-exception v0

    .line 143
    .local v0, "e":Lorg/json/JSONException;
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0
.end method

.method public declared-synchronized start()V
    .locals 1

    .prologue
    .line 151
    monitor-enter p0

    :try_start_0
    invoke-super {p0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 152
    monitor-exit p0

    return-void

    .line 151
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
